<%@ page language="java" pageEncoding="UTF-8"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<%@ taglib uri="/WEB-INF/geek.tld" prefix="geek" %>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>web-geek</title>

    <link rel="stylesheet" type="text/css" href="resources/css/ext-all.css" />
    
    <link rel="stylesheet" type="text/css" href="resources/css/geek.css" />
    

 	<script type="text/javascript" src="resources/javaScript/core/ext-base.js"></script>

   <!--  <script type="text/javascript" src="resources/javaScript/core/ext-all.js"></script> -->
    <script type="text/javascript" src="resources/javaScript/core/ext-all-debug-w-comments.js"></script>
    <script type="text/javascript" src="resources/javaScript/core/ext-lang-zh_CN.js"></script>
    
    <script type="text/javascript" src="resources/javaScript/ux/Ext.ux.override.js"></script>
    <script type="text/javascript" src="resources/javaScript/ux/SearchField.js"></script>
    <script type="text/javascript" src="resources/javaScript/ux/ComboBoxTree.js"></script>
    <script type="text/javascript" src="resources/javaScript/module/data.js"></script>
</head>
<style type="text/css">
 #loading-mask {
	Z-INDEX: 20000;
	LEFT: 0px;
	WIDTH: 100%;
	POSITION: absolute;
	TOP: 0px;
	HEIGHT: 100%;
	BACKGROUND-COLOR: white
}
#loading {
	PADDING-RIGHT: 2px;
	PADDING-LEFT: 2px;
	Z-INDEX: 20001;
	LEFT: 42%;
	PADDING-BOTTOM: 2px;
	PADDING-TOP: 2px;
	POSITION: absolute;
	TOP: 40%;
	HEIGHT: auto
}
#loading IMG {
	MARGIN-BOTTOM: 5px
}
#loading .loading-indicator {
	PADDING-RIGHT: 10px;
	PADDING-LEFT: 10px;
	BACKGROUND: white;
	PADDING-BOTTOM: 10px;
	MARGIN: 0px;
	FONT: 12px 宋体, arial, helvetica;
	COLOR: #555;
	PADDING-TOP: 10px;
	HEIGHT: auto;
	TEXT-ALIGN: center
}
</style>
<script type="text/javascript">
Ext.EventManager.on(window, 'load', function(){
	 setTimeout(
		 function() {
			Ext.get('loading').remove();
			Ext.get('loading-mask').fadeOut({remove:true});
			}, 1); 
});
</script>
<DIV id=loading-mask></DIV>
<DIV id=loading>
<DIV class=loading-indicator><IMG style="MARGIN-RIGHT: 5px" 
	height=40
	src="resources/images/ajax.gif"
	width=40 align=absMiddle>系统正在加载，请稍后...</DIV>
</DIV> 
<body scroll="no">
	<geek:IndexTag list="${nav}"/>
</body>

<script type="text/javascript">
Ext.Ajax.on('requestexception', function(conn, response, options) {
	if (response.status == -1) {
		setTimeout(function(){
			//延时避免被failure回调函数中的aler覆盖
			top.Ext.MessageBox.alert('提示', '请求失败,超时或服务器无响应.', function() {
			});
		},200);		
	}else{
	     showException(response.responseText);
	}
});

function showException(strMsg) {
	var shortWindow = new Ext.Window({
		title : '系统发生错误', 
		iconCls : 'ok',
		width : 400, 
		height : 300, 
		animateTarget : Ext.getBody(),
		closable : true, 
		closeAction : 'close', 
		collapsible : false, 
		modal : true,
		maximizable : false, 
		border : false, 
		constrain : true, 
		items : [new Ext.Panel({
					html : '您好，服务出错，请联系管理员',
					autoScroll : true
				})],
		buttons : [{
					text : '更多信息',
					iconCls : 'add',
					handler : function() {
						var detailWindow = new Ext.Window({
									title : '<span class="commoncss">系统运行时异常堆栈详细信息</span>',
									layout : 'fit', 
									width : document.body.clientWidth - 300, 
									height : document.body.clientHeight - 80, 
									animateTarget : Ext.getBody(),
									closable : true, 
									closeAction : 'close', 
									collapsible : false, 
									modal : true,
									maximizable : false, 
									border : false, 
									constrain : true, 
									buttons:[{
										text : '关闭',
										iconCls : 'delete',
										handler : function() {
										    detailWindow.hide();
										}
									}],
									items : [new Ext.Panel({
												html : strMsg,
												style : "font-size: 13px;",
												autoScroll : true
											})]
								}).show();
					}
				},{
					text : '关闭',
					iconCls : 'delete',
					handler : function() {
					    shortWindow.close();
					}
				}]
	}).show();
}
</script>
</html>